package com.topvision.common.enumeration;

/**
 * @author shengwm
 * @version V0.0.1
 * @Title: LoginType
 * @Package com.topvision.common.enumeration
 * @Description: TODO
 * @date 2017/4/19
 */
public enum LoginType implements BaseEnum {
    ACCOUNT("account", "账号密码"), NUMBER("number", "工号"),

    EMAIL("email", "邮箱"), MOBILE("mobile", "手机验证码");

    private final String value;
    private final String label;

    LoginType(String value, String label) {
        this.value = value;
        this.label = label;
    }

    /**
     * 获取值
     *
     * @return
     */
    @Override
    public String getValue() {
        return value;
    }

    /**
     * 获取标签
     *
     * @return
     */
    @Override
    public String getLabel() {
        return label;
    }

    /**
     * vlaue
     *
     * @param vlaue
     * @return
     */
    public static LoginType getJobStatusByValue(String vlaue) {
        for (LoginType subEnum : values()) {
            if (subEnum.getValue().equals(vlaue)) {
                return subEnum;
            }
        }
        return null;
    }
}
